{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "from __future__ import print_function\n",
    "from sympy import Symbol, symbols, sin, cos, Rational, expand, simplify, collect, S\n",
    "from galgebra.printer import Eprint, Get_Program, Print_Function, Format\n",
    "from galgebra.ga import Ga, one, zero\n",
    "from galgebra.mv import Nga\n",
    "Format()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [],
   "source": [
    "X = (x, y, z) = symbols('x y z')\n",
    "o3d = Ga('e_x e_y e_z', g=[1, 1, 1], coords=X)\n",
    "(ex, ey, ez) = o3d.mv()\n",
    "grad = o3d.grad"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [],
   "source": [
    "c = o3d.mv('c', 'scalar')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [],
   "source": [
    "a = o3d.mv('a', 'vector')\n",
    "b = o3d.mv('b', 'vector')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [],
   "source": [
    "A = o3d.mv('A','mv')\n",
    "B = o3d.mv('B','mv')"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "The inner product of blades in GAlgebra is zero if either operand is a scalar:\n",
    "\n",
    "$$\\begin{split}\\begin{aligned}\n",
    "      {\\boldsymbol{A}}_{r}{\\wedge}{\\boldsymbol{B}}_{s} &\\equiv {\\left <{{\\boldsymbol{A}}_{r}{\\boldsymbol{B}}_{s}} \\right >_{r+s}} \\\\\n",
    "      {\\boldsymbol{A}}_{r}\\cdot{\\boldsymbol{B}}_{s} &\\equiv {\\left \\{ { \\begin{array}{cc}\n",
    "      r\\mbox{ and }s \\ne 0: & {\\left <{{\\boldsymbol{A}}_{r}{\\boldsymbol{B}}_{s}} \\right >_{{\\left |{r-s}\\right |}}}  \\\\\n",
    "      r\\mbox{ or }s = 0: & 0 \\end{array}} \\right \\}}\n",
    "   \\end{aligned}\\end{split}$$\n",
    "   \n",
    "This definition comes from _David Hestenes and Garret Sobczyk, “Clifford Algebra to Geometric Calculus,” Kluwer Academic Publishers, 1984_.\n",
    "\n",
    "In some other literature, the inner product is defined without the exceptional case for scalar part and the definition above is known as \"the modified Hestenes inner product\" (this name comes from the source code of [GAViewer](http://www.geometricalgebra.net/gaviewer_download.html))."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/latex": [
       "\\begin{equation*}  0  \\end{equation*}"
      ],
      "text/plain": [
       "0"
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "c|a"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/latex": [
       "\\begin{equation*}  0  \\end{equation*}"
      ],
      "text/plain": [
       "0"
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "a|c"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/latex": [
       "\\begin{equation*}  0  \\end{equation*}"
      ],
      "text/plain": [
       "0"
      ]
     },
     "execution_count": 8,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "c|A"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/latex": [
       "\\begin{equation*}  0  \\end{equation*}"
      ],
      "text/plain": [
       "0"
      ]
     },
     "execution_count": 9,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "A|c"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "$ab=a \\wedge b + a \\cdot b$ holds for vectors:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "data": {
      "text/latex": [
       "\\begin{equation*} \\left ( a^{x} b^{x} + a^{y} b^{y} + a^{z} b^{z}\\right )  + \\left ( a^{x} b^{y} - a^{y} b^{x}\\right ) \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{y} + \\left ( a^{x} b^{z} - a^{z} b^{x}\\right ) \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{z} + \\left ( a^{y} b^{z} - a^{z} b^{y}\\right ) \\boldsymbol{e}_{y}\\wedge \\boldsymbol{e}_{z} \\end{equation*}"
      ],
      "text/plain": [
       "a__x*b__x + a__y*b__y + a__z*b__z + (a__x*b__y - a__y*b__x)*e_x^e_y + (a__x*b__z - a__z*b__x)*e_x^e_z + (a__y*b__z - a__z*b__y)*e_y^e_z"
      ]
     },
     "execution_count": 10,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "a*b"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/latex": [
       "\\begin{equation*} \\left ( a^{x} b^{y} - a^{y} b^{x}\\right ) \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{y} + \\left ( a^{x} b^{z} - a^{z} b^{x}\\right ) \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{z} + \\left ( a^{y} b^{z} - a^{z} b^{y}\\right ) \\boldsymbol{e}_{y}\\wedge \\boldsymbol{e}_{z} \\end{equation*}"
      ],
      "text/plain": [
       "(a__x*b__y - a__y*b__x)*e_x^e_y + (a__x*b__z - a__z*b__x)*e_x^e_z + (a__y*b__z - a__z*b__y)*e_y^e_z"
      ]
     },
     "execution_count": 11,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "a^b"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "data": {
      "text/latex": [
       "\\begin{equation*} a^{x} b^{x} + a^{y} b^{y} + a^{z} b^{z} \\end{equation*}"
      ],
      "text/plain": [
       "a__x*b__x + a__y*b__y + a__z*b__z"
      ]
     },
     "execution_count": 12,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "a|b"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "data": {
      "text/latex": [
       "\\begin{equation*}  0  \\end{equation*}"
      ],
      "text/plain": [
       "0"
      ]
     },
     "execution_count": 13,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "(a*b)-(a^b)-(a|b)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "$aA=a \\wedge A + a \\cdot A$ holds for the products between vectors and multivectors:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/latex": [
       "\\begin{equation*} \\left ( A^{x} a^{x} + A^{y} a^{y} + A^{z} a^{z}\\right )  + \\left ( A a^{x} - A^{xy} a^{y} - A^{xz} a^{z}\\right ) \\boldsymbol{e}_{x} + \\left ( A a^{y} + A^{xy} a^{x} - A^{yz} a^{z}\\right ) \\boldsymbol{e}_{y} + \\left ( A a^{z} + A^{xz} a^{x} + A^{yz} a^{y}\\right ) \\boldsymbol{e}_{z} + \\left ( - A^{x} a^{y} + A^{xyz} a^{z} + A^{y} a^{x}\\right ) \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{y} + \\left ( - A^{x} a^{z} - A^{xyz} a^{y} + A^{z} a^{x}\\right ) \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{z} + \\left ( A^{xyz} a^{x} - A^{y} a^{z} + A^{z} a^{y}\\right ) \\boldsymbol{e}_{y}\\wedge \\boldsymbol{e}_{z} + \\left ( A^{xy} a^{z} - A^{xz} a^{y} + A^{yz} a^{x}\\right ) \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{y}\\wedge \\boldsymbol{e}_{z} \\end{equation*}"
      ],
      "text/plain": [
       "A__x*a__x + A__y*a__y + A__z*a__z + (A*a__x - A__xy*a__y - A__xz*a__z)*e_x + (A*a__y + A__xy*a__x - A__yz*a__z)*e_y + (A*a__z + A__xz*a__x + A__yz*a__y)*e_z + (-A__x*a__y + A__xyz*a__z + A__y*a__x)*e_x^e_y + (-A__x*a__z - A__xyz*a__y + A__z*a__x)*e_x^e_z + (A__xyz*a__x - A__y*a__z + A__z*a__y)*e_y^e_z + (A__xy*a__z - A__xz*a__y + A__yz*a__x)*e_x^e_y^e_z"
      ]
     },
     "execution_count": 14,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "a*A"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/latex": [
       "\\begin{equation*} A a^{x} \\boldsymbol{e}_{x} + A a^{y} \\boldsymbol{e}_{y} + A a^{z} \\boldsymbol{e}_{z} + \\left ( - A^{x} a^{y} + A^{y} a^{x}\\right ) \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{y} + \\left ( - A^{x} a^{z} + A^{z} a^{x}\\right ) \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{z} + \\left ( - A^{y} a^{z} + A^{z} a^{y}\\right ) \\boldsymbol{e}_{y}\\wedge \\boldsymbol{e}_{z} + \\left ( A^{xy} a^{z} - A^{xz} a^{y} + A^{yz} a^{x}\\right ) \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{y}\\wedge \\boldsymbol{e}_{z} \\end{equation*}"
      ],
      "text/plain": [
       "A*a__x*e_x + A*a__y*e_y + A*a__z*e_z + (-A__x*a__y + A__y*a__x)*e_x^e_y + (-A__x*a__z + A__z*a__x)*e_x^e_z + (-A__y*a__z + A__z*a__y)*e_y^e_z + (A__xy*a__z - A__xz*a__y + A__yz*a__x)*e_x^e_y^e_z"
      ]
     },
     "execution_count": 15,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "a^A"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/latex": [
       "\\begin{equation*} \\left ( A^{x} a^{x} + A^{y} a^{y} + A^{z} a^{z}\\right )  + \\left ( - A^{xy} a^{y} - A^{xz} a^{z}\\right ) \\boldsymbol{e}_{x} + \\left ( A^{xy} a^{x} - A^{yz} a^{z}\\right ) \\boldsymbol{e}_{y} + \\left ( A^{xz} a^{x} + A^{yz} a^{y}\\right ) \\boldsymbol{e}_{z} + A^{xyz} a^{z} \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{y} - A^{xyz} a^{y} \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{z} + A^{xyz} a^{x} \\boldsymbol{e}_{y}\\wedge \\boldsymbol{e}_{z} \\end{equation*}"
      ],
      "text/plain": [
       "A__x*a__x + A__y*a__y + A__z*a__z + (-A__xy*a__y - A__xz*a__z)*e_x + (A__xy*a__x - A__yz*a__z)*e_y + (A__xz*a__x + A__yz*a__y)*e_z + A__xyz*a__z*e_x^e_y - A__xyz*a__y*e_x^e_z + A__xyz*a__x*e_y^e_z"
      ]
     },
     "execution_count": 16,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "a|A"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/latex": [
       "\\begin{equation*}  0  \\end{equation*}"
      ],
      "text/plain": [
       "0"
      ]
     },
     "execution_count": 17,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "(a*A)-(a^A)-(a|A)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "$AB=A \\wedge B + A \\cdot B$ does NOT hold for the products between multivectors and multivectors:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/latex": [
       "\\begin{equation*} \\left ( A B + A^{x} B^{x} - A^{xy} B^{xy} - A^{xyz} B^{xyz} - A^{xz} B^{xz} + A^{y} B^{y} - A^{yz} B^{yz} + A^{z} B^{z}\\right )  + \\left ( A B^{x} + A^{x} B + A^{xy} B^{y} - A^{xyz} B^{yz} + A^{xz} B^{z} - A^{y} B^{xy} - A^{yz} B^{xyz} - A^{z} B^{xz}\\right ) \\boldsymbol{e}_{x} + \\left ( A B^{y} + A^{x} B^{xy} - A^{xy} B^{x} + A^{xyz} B^{xz} + A^{xz} B^{xyz} + A^{y} B + A^{yz} B^{z} - A^{z} B^{yz}\\right ) \\boldsymbol{e}_{y} + \\left ( A B^{z} + A^{x} B^{xz} - A^{xy} B^{xyz} - A^{xyz} B^{xy} - A^{xz} B^{x} + A^{y} B^{yz} - A^{yz} B^{y} + A^{z} B\\right ) \\boldsymbol{e}_{z} + \\left ( A B^{xy} + A^{x} B^{y} + A^{xy} B + A^{xyz} B^{z} - A^{xz} B^{yz} - A^{y} B^{x} + A^{yz} B^{xz} + A^{z} B^{xyz}\\right ) \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{y} + \\left ( A B^{xz} + A^{x} B^{z} + A^{xy} B^{yz} - A^{xyz} B^{y} + A^{xz} B - A^{y} B^{xyz} - A^{yz} B^{xy} - A^{z} B^{x}\\right ) \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{z} + \\left ( A B^{yz} + A^{x} B^{xyz} - A^{xy} B^{xz} + A^{xyz} B^{x} + A^{xz} B^{xy} + A^{y} B^{z} + A^{yz} B - A^{z} B^{y}\\right ) \\boldsymbol{e}_{y}\\wedge \\boldsymbol{e}_{z} + \\left ( A B^{xyz} + A^{x} B^{yz} + A^{xy} B^{z} + A^{xyz} B - A^{xz} B^{y} - A^{y} B^{xz} + A^{yz} B^{x} + A^{z} B^{xy}\\right ) \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{y}\\wedge \\boldsymbol{e}_{z} \\end{equation*}"
      ],
      "text/plain": [
       "A*B + A__x*B__x - A__xy*B__xy - A__xyz*B__xyz - A__xz*B__xz + A__y*B__y - A__yz*B__yz + A__z*B__z + (A*B__x + A__x*B + A__xy*B__y - A__xyz*B__yz + A__xz*B__z - A__y*B__xy - A__yz*B__xyz - A__z*B__xz)*e_x + (A*B__y + A__x*B__xy - A__xy*B__x + A__xyz*B__xz + A__xz*B__xyz + A__y*B + A__yz*B__z - A__z*B__yz)*e_y + (A*B__z + A__x*B__xz - A__xy*B__xyz - A__xyz*B__xy - A__xz*B__x + A__y*B__yz - A__yz*B__y + A__z*B)*e_z + (A*B__xy + A__x*B__y + A__xy*B + A__xyz*B__z - A__xz*B__yz - A__y*B__x + A__yz*B__xz + A__z*B__xyz)*e_x^e_y + (A*B__xz + A__x*B__z + A__xy*B__yz - A__xyz*B__y + A__xz*B - A__y*B__xyz - A__yz*B__xy - A__z*B__x)*e_x^e_z + (A*B__yz + A__x*B__xyz - A__xy*B__xz + A__xyz*B__x + A__xz*B__xy + A__y*B__z + A__yz*B - A__z*B__y)*e_y^e_z + (A*B__xyz + A__x*B__yz + A__xy*B__z + A__xyz*B - A__xz*B__y - A__y*B__xz + A__yz*B__x + A__z*B__xy)*e_x^e_y^e_z"
      ]
     },
     "execution_count": 18,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "A*B"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/latex": [
       "\\begin{equation*} \\left ( A^{x} B^{x} - A^{xy} B^{xy} - A^{xyz} B^{xyz} - A^{xz} B^{xz} + A^{y} B^{y} - A^{yz} B^{yz} + A^{z} B^{z}\\right )  + \\left ( A^{xy} B^{y} - A^{xyz} B^{yz} + A^{xz} B^{z} - A^{y} B^{xy} - A^{yz} B^{xyz} - A^{z} B^{xz}\\right ) \\boldsymbol{e}_{x} + \\left ( A^{x} B^{xy} - A^{xy} B^{x} + A^{xyz} B^{xz} + A^{xz} B^{xyz} + A^{yz} B^{z} - A^{z} B^{yz}\\right ) \\boldsymbol{e}_{y} + \\left ( A^{x} B^{xz} - A^{xy} B^{xyz} - A^{xyz} B^{xy} - A^{xz} B^{x} + A^{y} B^{yz} - A^{yz} B^{y}\\right ) \\boldsymbol{e}_{z} + \\left ( A^{xyz} B^{z} + A^{z} B^{xyz}\\right ) \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{y} + \\left ( - A^{xyz} B^{y} - A^{y} B^{xyz}\\right ) \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{z} + \\left ( A^{x} B^{xyz} + A^{xyz} B^{x}\\right ) \\boldsymbol{e}_{y}\\wedge \\boldsymbol{e}_{z} \\end{equation*}"
      ],
      "text/plain": [
       "A__x*B__x - A__xy*B__xy - A__xyz*B__xyz - A__xz*B__xz + A__y*B__y - A__yz*B__yz + A__z*B__z + (A__xy*B__y - A__xyz*B__yz + A__xz*B__z - A__y*B__xy - A__yz*B__xyz - A__z*B__xz)*e_x + (A__x*B__xy - A__xy*B__x + A__xyz*B__xz + A__xz*B__xyz + A__yz*B__z - A__z*B__yz)*e_y + (A__x*B__xz - A__xy*B__xyz - A__xyz*B__xy - A__xz*B__x + A__y*B__yz - A__yz*B__y)*e_z + (A__xyz*B__z + A__z*B__xyz)*e_x^e_y + (-A__xyz*B__y - A__y*B__xyz)*e_x^e_z + (A__x*B__xyz + A__xyz*B__x)*e_y^e_z"
      ]
     },
     "execution_count": 19,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "A|B"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "data": {
      "text/latex": [
       "\\begin{equation*} \\left ( - A^{xz} B^{yz} + A^{yz} B^{xz}\\right ) \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{y} + \\left ( A^{xy} B^{yz} - A^{yz} B^{xy}\\right ) \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{z} + \\left ( - A^{xy} B^{xz} + A^{xz} B^{xy}\\right ) \\boldsymbol{e}_{y}\\wedge \\boldsymbol{e}_{z} \\end{equation*}"
      ],
      "text/plain": [
       "(-A__xz*B__yz + A__yz*B__xz)*e_x^e_y + (A__xy*B__yz - A__yz*B__xy)*e_x^e_z + (-A__xy*B__xz + A__xz*B__xy)*e_y^e_z"
      ]
     },
     "execution_count": 20,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "(A*B)-(A^B)-(A|B)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/latex": [
       "\\begin{equation*} \\left ( A B + 2 A^{x} B^{x} - 2 A^{xy} B^{xy} - 2 A^{xyz} B^{xyz} - 2 A^{xz} B^{xz} + 2 A^{y} B^{y} - 2 A^{yz} B^{yz} + 2 A^{z} B^{z}\\right )  + \\left ( A^{xy} B^{y} - A^{xyz} B^{yz} + A^{xz} B^{z} - A^{y} B^{xy} - A^{yz} B^{xyz} - A^{z} B^{xz}\\right ) \\boldsymbol{e}_{x} + \\left ( A^{x} B^{xy} - A^{xy} B^{x} + A^{xyz} B^{xz} + A^{xz} B^{xyz} + A^{yz} B^{z} - A^{z} B^{yz}\\right ) \\boldsymbol{e}_{y} + \\left ( A^{x} B^{xz} - A^{xy} B^{xyz} - A^{xyz} B^{xy} - A^{xz} B^{x} + A^{y} B^{yz} - A^{yz} B^{y}\\right ) \\boldsymbol{e}_{z} + \\left ( - A^{x} B^{y} + A^{xyz} B^{z} + A^{xz} B^{yz} + A^{y} B^{x} - A^{yz} B^{xz} + A^{z} B^{xyz}\\right ) \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{y} + \\left ( - A^{x} B^{z} - A^{xy} B^{yz} - A^{xyz} B^{y} - A^{y} B^{xyz} + A^{yz} B^{xy} + A^{z} B^{x}\\right ) \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{z} + \\left ( A^{x} B^{xyz} + A^{xy} B^{xz} + A^{xyz} B^{x} - A^{xz} B^{xy} - A^{y} B^{z} + A^{z} B^{y}\\right ) \\boldsymbol{e}_{y}\\wedge \\boldsymbol{e}_{z} + \\left ( - A^{x} B^{yz} - A^{xy} B^{z} + A^{xz} B^{y} + A^{y} B^{xz} - A^{yz} B^{x} - A^{z} B^{xy}\\right ) \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{y}\\wedge \\boldsymbol{e}_{z} \\end{equation*}"
      ],
      "text/plain": [
       "A*B + 2*A__x*B__x - 2*A__xy*B__xy - 2*A__xyz*B__xyz - 2*A__xz*B__xz + 2*A__y*B__y - 2*A__yz*B__yz + 2*A__z*B__z + (A__xy*B__y - A__xyz*B__yz + A__xz*B__z - A__y*B__xy - A__yz*B__xyz - A__z*B__xz)*e_x + (A__x*B__xy - A__xy*B__x + A__xyz*B__xz + A__xz*B__xyz + A__yz*B__z - A__z*B__yz)*e_y + (A__x*B__xz - A__xy*B__xyz - A__xyz*B__xy - A__xz*B__x + A__y*B__yz - A__yz*B__y)*e_z + (-A__x*B__y + A__xyz*B__z + A__xz*B__yz + A__y*B__x - A__yz*B__xz + A__z*B__xyz)*e_x^e_y + (-A__x*B__z - A__xy*B__yz - A__xyz*B__y - A__y*B__xyz + A__yz*B__xy + A__z*B__x)*e_x^e_z + (A__x*B__xyz + A__xy*B__xz + A__xyz*B__x - A__xz*B__xy - A__y*B__z + A__z*B__y)*e_y^e_z + (-A__x*B__yz - A__xy*B__z + A__xz*B__y + A__y*B__xz - A__yz*B__x - A__z*B__xy)*e_x^e_y^e_z"
      ]
     },
     "execution_count": 21,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "(A<B)+(A|B)+(A>B)-A*B"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.0"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
